﻿#pragma once

#include "ccMacros.h"
#define ASSERT(__assert__) CCAssert(__assert__,"Could not run here...")


#include <map>
#include <string>
#include <vector>


#define DEBUG_PDK_HEAD "DPK"
#define DEBUG_PDK_HEAD_LENGTH 8

#define DEBUG_DPK_KEY "bilt"

#define DEBUG_PDK_PATH_MAX_LENGTH 200


struct SDpkNodeMapData
{
	int		nSize;
	void*	pData;
};


struct SDpkNodeVectorData
{
	char    szPathName[DEBUG_PDK_PATH_MAX_LENGTH];
	int		nSize;
	void*	pData;
};

enum DPK_READ_ERROR
{
	DPK_SUCCESS,
	DPK_FILE_OPEN_ERROR,
	DPK_FILE_HEAD_ERROR,
	DPK_CRC_ERROR,
};

typedef std::map<std::string,SDpkNodeMapData> DpkNodeMap;
typedef std::vector<SDpkNodeVectorData> DpkNodeArray;

typedef DpkNodeMap::iterator DpkNodeMapIt;
typedef DpkNodeMap::value_type DpkNodeMapType;

//读取dpk
DPK_READ_ERROR ReadDataPack( LPCSTR dpkName,LPCSTR dpkKey,DpkNodeMap & dataArr );

DPK_READ_ERROR ReadDpkWithData(LPCSTR pData,int nSize,LPCSTR dpkKey,DpkNodeMap & dataArr );

//加密-解密
void Luck(char* pData,int nLen,LPCSTR szKey);

